// 文件路径: src/main/java/com/chixing/controller/CouponController.java

package com.chixing.controller;

import com.chixing.entity.Coupon;
import com.chixing.service.ICouponService;
import com.chixing.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 优惠券前端控制器
 * </p>
 *
 * @author liwenjing
 * @since 2025-10-07
 */
@RestController
@RequestMapping("/coupon")
public class CouponController {

    @Autowired
    private ICouponService couponService;
    @GetMapping("{id}")
    public Result getById(@PathVariable("id") Integer id){
        return couponService.getById(id);
    }
    @GetMapping("userId/{userId}/status/{couponStatus}")
    public Result getByStatus(@PathVariable("userId") Integer userId ,
            @PathVariable("couponStatus") Integer couponStatus){
        return couponService.getByStatus(userId,couponStatus);
    }



}

